package com.k2data.k2app.service;

import com.k2data.k2app.domain.SysLog;
import com.k2data.k2app.domain.dto.SysLogCondDTO;
import com.k2data.k2app.mapper.SysLogMapper;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author lidong 17-3-6.
 */
@Log4j2
@Service
public class SysLogService {

    private final SysLogMapper sysLogMapper;

    @Autowired
    public SysLogService(SysLogMapper testMapper) {
        this.sysLogMapper = testMapper;
    }

    @Transactional
    public int insert(SysLog sysLog) {
        return sysLogMapper.insert(sysLog);
    }

    @Transactional
    public int insertSelected(SysLog sysLog) {
        return sysLogMapper.insertSelective(sysLog);
    }

    public List<SysLog> selectSysLog(SysLogCondDTO sysLogCondDTO){
        return sysLogMapper.selectByCondition(sysLogCondDTO);
    }

}
